<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ThoughtWorks_104</title>
    <link rel="stylesheet" href="../common/css/bootstrap.min.css">
    <style>
        .container-fluid {
            padding: 0;
        }

        p {
            font-size: 15px;
            text-indent: 50px;
        }

        .select {
            text-indent: 55px;
        }
    </style>
</head>
<body>
<div class="container-fluid ">
    <div class="row">
        <h2 class="col-xs-12"><strong>统一建模语言理论测试</strong></h2>
    </div>
    <div class="row">
        <h4 class="col-md-2">考试科目：</h4>
        <h4 class="col-md-2">时间：100分钟</h4>
        <h4 class="col-md-2" id="Score">得分：0</h4>
    </div>
    <div class="row">
        <h4 class="col-md-2">班级：<input value="1班"></h4>
        <h4 class="col-md-2">学号：<input value="001"></h4>
        <h4 class="col-md-2">姓名：<input value="王小闹"></h4>
    </div>
    <form action="index.html" method="post" name="form_text">
        <h3 class="col-md-12"><strong>一、填空题（每空5分，共20分）</strong></h3>
        <p class="col-md-12">1. UML的中文全称是：<input value="" name="Problem_1"></p>
        <p class="col-md-12">2. 对象最突出的特征是：<input value="" name="Problem_2"><input value="" name="Problem_2"><input
                value="" name="Problem_2">
        </p>

        <h3 class="col-md-12"><strong>二、选择题（每题10分，共20分）</strong></h3>
        <p class="col-md-12">1. UML与软件工程的关系是：</p>
        <div class="col-md-12">
            <div class="col-md-12 select"><input type="radio" name="Problem_3">(A) UML就是软件工程
            </div>
            <div class="col-md-12 select"><input type="radio" name="Problem_3">(B) UML参与到软件工程中软件开发过程的几个阶段
            </div>
            <div class="col-md-12 select"><input type="radio" name="Problem_3">(C) UML与软件工程无关
            </div>
            <div class="col-md-12 select"><input type="radio" name="Problem_3">(D) UML是软件工程的一部分
            </div>
        </div>
        <p class="col-md-12">2. Java语言支持：</p>
        <div class="col-md-12">
            <div class="col-md-12 select"><input type="radio" name="Problem_4">(A) 单继承</div>
            <div class="col-md-12 select"><input type="radio" name="Problem_4">(B) 多继承</div>
            <div class="col-md-12 select"><input type="radio" name="Problem_4">(C) 单继承和多继承都支持</div>
            <div class="col-md-12 select"><input type="radio" name="Problem_4">(D) 单继承和多继承都不支持</div>
        </div>
        <h3 class="col-md-12"><strong>三、多择题（每题10分，共20分）</strong></h3>
        <p class="col-md-12">1. 用例的粒度分为以下哪三种：</p>
        <div class="col-md-12">
            <div class="col-md-12 select"><input type="checkbox" name="Problem_5">(A) 概述级</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_5">(B) 需求级</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_5">(C) 用户目标级</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_5">(D) 子功能级</div>
        </div>
        <p class="col-md-12">2. 类图由以下哪三部分组成：</p>
        <div class="col-md-12">
            <div class="col-md-12 select"><input type="checkbox" name="Problem_6">(A) 名称(Name)</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_6">(B) 属性(Attribute)</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_6">(C) 操作(Operation)</div>
            <div class="col-md-12 select"><input type="checkbox" name="Problem_6">(D) 方法(Function)</div>
        </div>
        <h3 class="col-md-12"><strong>四、判断题（每题10分，共20分）</strong></h3>
        <div class="col-md-12">
            <p class="col-md-12">1. 用例图只是用于和客户交流和沟通的,用于确定需求。<input type="radio" name="Problem_7">√<input type="radio"
                                                                                                         name="Problem_7">×
            </p>
        </div>
        <div class="col-md-12">
            <p class="col-md-12">2. 在状态图中,终止状态在一个状态图中允许有任意多个。<input type="radio" name="Problem_8">√<input type="radio"
                                                                                                          name="Problem_8">×
            </p>
        </div>
        <h3 class="col-md-12"><strong>五、简答题（每题20分，共20分）</strong></h3>
        <p class="col-md-12">1. 简述什么是模型以及模型的表现形式？</p>
        <div class="col-md-12"><textarea style="width: 70%;height: 90px; " name="Problem_9"></textarea>
        </div>
        <input type="button" onclick="score()" value="计算分数">
    </form>
</div>

</body>
<script type="text/javascript" src="../common/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../common/js/bootstrap.min.js"></script>
<script>
    function score() {

        var All_Score = 0;
        var fm = document.form_text;
        //判断是否有未答题
        for(var l=0;l<document.form_text.elements.length-1;l++)
        {
         if(document.form_text.elements[l].value=="")
         {
           alert("有题目未作答");
           document.form_text.elements[l].focus();
         }
        }
                //填空题
        if (fm.elements[0].value == "统计建模语言") {
            All_Score = All_Score + 5;
        }
        for (var i=1;i<=3;i++) {
            if (fm.elements[i].value == "继承性") {
                All_Score = All_Score + 5;
                continue;
            }
            else if (fm.elements[i].value == "封装性") {
                All_Score = All_Score + 5;
                continue;
            }
            if (fm.elements[i].value == "多态性") {
                All_Score = All_Score + 5;
                continue;
            }
        }
        //单选题
        var i = document.getElementsByName("Problem_3");
        if (i[1].checked) {
            All_Score = All_Score + 5;
        }
        var i = document.getElementsByName("Problem_4");
        if (i[0].checked) {
            All_Score = All_Score + 5;
        }
        //多选题
        var i = document.getElementsByName("Problem_5");
        if (i[0].checked && i[1].checked && i[3].checked) {
            All_Score = All_Score + 10;
        }
        var i = document.getElementsByName("Problem_6");
        if (i[0].checked && i[1].checked && i[2].checked) {
            All_Score = All_Score + 10;
        }
        //判断题
        var i = document.getElementsByName("Problem_7");
        if (i[1].checked) {
            All_Score = All_Score + 10;
        }
        var i = document.getElementsByName("Problem_8");
        if (i[0].checked) {
            All_Score = All_Score + 10;
        }
        //简答题
        if (fm.elements[24].value =="模型是对现实世界的简化和抽象，模型是对所研究的系统、过程、事物或概念的一种表达方式。可以是物理实体；可以是某种图形；或者是一种数学表达式。") {
            All_Score = All_Score + 20;
        }
        document.getElementById("Score").innerHTML="得分：" + All_Score;
    }


</script>
</html>